<?php
/**
 * --------------------------------------------------------------
 * 友情链接验证器
 * --------------------------------------------------------------
 * Light Year Doc
 * @author yinq<3331653644@qq.com>
 * --------------------------------------------------------------
 */
namespace app\admin\validate;

use think\Validate;

class FriendLinks extends Validate
{
    // 定义验证规则
    protected $rule = [
        'title|友链名称' => 'require|length:1,30',
        'url|友链地址'   => 'require|url',
        'logo|友链LOGO' => 'requireIf:type,2',
    ];

    // 定义验证提示
    protected $message = [
        'logo.requireIf' => '请上传友链LOGO',
    ];
}